package cn.portx.entity;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;

import com.bstek.bdf3.dorado.jpa.annotation.Generator;
import com.bstek.dorado.annotation.PropertyDef;

import cn.portx.policy.CreateUserPolicy;
import cn.portx.policy.CreatedDatePolicy;
import cn.portx.policy.IdGeneratorPolicy;

/**
 * Model class of 收发单位.
 * 
 * @author generated by ERMaster
 * @version $Id$
 */
@Entity
@Table(name = "T_ORDER_SEND_RECEIVE")
public class OrderSendReceive extends BaseEntity {

	/** serialVersionUID. */
	private static final long serialVersionUID = 1L;

	/** 类型. */
	@Column(name = "TYPE_", length = 1)
	@PropertyDef(label = "类型", description = "类型:类型，0：收；1：发")
	private String type;

	/** 订单ID. */
	@Column(name = "ORDER_ID_", length = 60)
	@PropertyDef(label = "订单ID", description = "订单ID:订单ID")
	private String orderId;

	@Transient
	private Order order;

	@Column(name = "FACTORY_ID_", length = 60)
	private String factoryId;

	/** 工厂名称. */
	@Column(name = "FACTORY_NAME_", length = 100)
	@PropertyDef(label = "工厂名称", description = "工厂名称:工厂名称")
	private String factoryName;

	/** 地址. */
	@Column(name = "ADDRESS_", length = 120)
	@PropertyDef(label = "地址", description = "地址:地址")
	private String address;

	/** 联系人. */
	@Column(name = "CONTACT_", length = 20)
	@PropertyDef(label = "联系人", description = "联系人:联系人")
	private String contact;

	/** 联系电话. */
	@Column(name = "TEL_", length = 20)
	@PropertyDef(label = "联系电话", description = "联系电话:联系电话")
	private String tel;

	/**
	 * Constructor.
	 */
	public OrderSendReceive() {
	}

	/**
	 * Set the 类型.
	 * 
	 * @param type
	 *            类型
	 */
	public void setType(String type) {
		this.type = type;
	}

	/**
	 * Get the 类型.
	 * 
	 * @return 类型
	 */
	public String getType() {
		return this.type;
	}

	/**
	 * Set the 订单ID.
	 * 
	 * @param orderId
	 *            订单ID
	 */
	public void setOrderId(String orderId) {
		this.orderId = orderId;
	}

	/**
	 * Get the 订单ID.
	 * 
	 * @return 订单ID
	 */
	public String getOrderId() {
		return this.orderId;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public String getFactoryName() {
		return factoryName;
	}

	public void setFactoryName(String factoryName) {
		this.factoryName = factoryName;
	}

	public String getAddress() {
		return address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getContact() {
		return contact;
	}

	public void setContact(String contact) {
		this.contact = contact;
	}

	public String getTel() {
		return tel;
	}

	public void setTel(String tel) {
		this.tel = tel;
	}

	public String getFactoryId() {
		return factoryId;
	}

	public void setFactoryId(String factoryId) {
		this.factoryId = factoryId;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result + ((this.getId() == null) ? 0 : this.getId().hashCode());
		return result;
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public boolean equals(Object obj) {
		if (this == obj) {
			return true;
		}
		if (obj == null) {
			return false;
		}
		if (getClass() != obj.getClass()) {
			return false;
		}
		OrderSendReceive other = (OrderSendReceive) obj;
		if (this.getId() == null) {
			if (other.getId() != null) {
				return false;
			}
		} else if (!this.getId().equals(other.getId())) {
			return false;
		}
		return true;
	}

}
